Release 10.1A: OpenEdge Development:
Messaging and ESB
Finding administered objects in JNDI or proprietary directories
A JMS-administered object is an object created by a JMS administrator and registered with a directory (typically a JNDI-compliant directory) under a name that is meaningful to the JMS clients. The object contains JMS configuration information that is created by a JMS administrator and later used by JMS clients. Java Naming and Directory Interface (JNDI) is an interface for JMS administrators to create and configure administered objects and store them in a namespace.
The SonicMQ-administered objects are:
For example, the administrator creates a
TopicConnectionFactoryobject, which contains all the JMS server connection parameters (communication protocol host and port), assigns it a name, and stores it in a JNDI directory. The client does not have to know the connection parameters to connect to the JMS server. The client finds the object by name in the directory and uses it to create connection objects. The administrator can change the connection parameters later without affecting client applications.The administrator can give the
TopicandQueueobjects meaningful aliases to shield the client from their internal names. For example, a topic with the internal JMS name ofsports.USA.Northeast.golfcould be stored in the directory undernorthern.golfers. For more information on administered objects, see the Java Message Service specification, SonicMQ Programming Guide , and SonicMQ Configuration and Management Guide .Using the OpenEdge Adapter for the SonicMQ and the 4GL-JMS API with administered objects
JMS does not impose any specific directory for storing administered objects (although it establishes the convention of using JNDI-compliant directories, such as LDAP). Also, the process of connecting to a JNDI server and obtaining an initial context is not standardized.
Therefore, to use directory-stored JMS objects, you must implement a Java class, compile it, and install the class file on the OpenEdge Adapter for the SonicMQ host under the OpenEdge Adapter for the SonicMQ’s
CLASSPATH. (For more information onCLASSPATH, see the "Setting the CLASSPATH" section.) The OpenEdge Adapter for the SonicMQ looks for that class when it starts up. If it finds the class, it creates an instance object of it and uses it to locate administered objects. If it does not find the class, the OpenEdge Adapter for the SonicMQ creates objects as required.jmsfrom4gl.AdminObjectFinder class
The following code is the skeleton of the
jmsfrom4gl.AdminObjectFinderclass. Use it as a template to create a class file and install it on the OpenEdge Adapter for the SonicMQ host; Unified Broker host for BrokerConnect, 4GL client host for ClientConnect, and AppServer or WebSpeed Transaction server host for the ServerConnect option.The
jmsfrom4gl.AdminObjectFindername is mandatory. The class and theget...()methods must be declared public. TheAdminObjectFinderclass must be part of thejmsfrom4glpackage and placed in a directory calledjmsfrom4gl. The directory that containsjmsfrom4glmust be on theCLASSPATHof the OpenEdge Adapter for SonicMQ. For example:
Notes: The
brokerURLstartup parameter is used as the input parameter for thegetTopicConnectionFactoryandgetQueueConnectionFactorymethods. For example, if the 4GL application calls the setBrokerURL procedure passing in the input parameterdirectory_factory_name, the 4GL-JMS implementation on the server side calls thegetTopicConnectionFactorymethod withdirectory_factory_nameas the parameter.
If thegetTopicConnectionFactoryandgetQueueConnectionFactorymethods are implemented, thejmsServerNamestartup parameter is ignored (since the identity of the server’s vendor is encapsulated in the object).
It is sufficient to implement methods for those objects that should be obtained from the directory. For example, it is legal to have anAdminObjectFinderclass with only thegetTopicConnectionFactorymethod. The 4GL-JMS implementation looks for the methods dynamically and does not fail if the other methods are missing.
If the object finder method returns null, the 4GL-JMS implementation tries to create the object as if the method is not there.
For more information onCLASSPATH, see the "Setting the CLASSPATH" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |